#ifndef _BUOLA_MEDIA_CMIXER_H_
#define _BUOLA_MEDIA_CMIXER_H_

#include <vector>
#include <buola/utility/uevent.h>

namespace buola { namespace media {

class CMixer : public UUncopiable
{
public:
    static const int CHANNEL_ALL=-1;
    
    typedef int64_t TElement;

protected:
    CMixer();
    virtual ~CMixer();

public:
    int GetElementCount();
    TElement GetMasterElement();
    TElement GetElement(int);

    virtual TElement GetElement(const std::wstring&)=0;

    virtual double GetVolume(TElement pElement,int pChannel=CHANNEL_ALL)=0;
    virtual void SetVolume(TElement pElement,double pValue,int pChannel=CHANNEL_ALL)=0;

    virtual bool GetMute(TElement pElement,int pChannel=CHANNEL_ALL)=0;
    virtual void SetMute(TElement pElement,bool pValue,int pChannel=CHANNEL_ALL)=0;
    virtual void ToggleMute(TElement pElement,int pChannel=CHANNEL_ALL);

    const std::wstring &GetMixerName()  {   return mMixerName;  }

    UEvent<void(TElement)> eChange;

protected:
    std::wstring mMixerName;

    std::vector<TElement> mElements;
};

CMixer &get_simple_mixer();

/*namespace media*/ } /*namespace buola*/ }

#endif
